package com.mybindview.adapter;

import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;

import java.util.List;

/**
 * Created by nbzl on 2017/2/23.
 */
public abstract class CommonAdapter extends BaseAdapter {
    public List<Object> list;
    public CommonAdapter(List<Object> list) {
        this.list=list;
    }

    @Override
    public int getCount() {
        return list.size();
    }

    @Override
    public Object getItem(int i) {
        return list.get(i);
    }

    @Override
    public long getItemId(int i) {
        return i;
    }

    @Override
    public View getView(int position, View view, ViewGroup viewGroup) {
        return bindViewItem(position,view,viewGroup,list.get(position));
    }
    public abstract View bindViewItem(final int position,final View view,final ViewGroup viewGroup,final Object obj);

}
